Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c: scope_hint: In function ‘device_event_cb.part.0’
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c:1448:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘udid’ where non-null expected
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c:32: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 1446|   			udid = strdup(event->udid);
# 1447|   		}
# 1448|-> 		if (strcmp(udid, event->udid) == 0) {
# 1449|   			connected = 1;
# 1450|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c: scope_hint: In function ‘main’
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:334:21: warning[-Wanalyzer-null-argument]: use of NULL ‘image_path’ where non-null expected
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/include/libimobiledevice/libimobiledevice.h:35: included_from: Included from here.
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:43: included_from: Included from here.
/usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null
#  332|   			}
#  333|   		}
#  334|-> 		if (stat(image_path, &fst) != 0) {
#  335|   			fprintf(stderr, "ERROR: stat: %s: %s\n", image_path, strerror(errno));
#  336|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:339:51: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_sig_path’ where non-null expected
/usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null
#  337|   		}
#  338|   		image_size = fst.st_size;
#  339|-> 		if (product_version_major < 17 && stat(image_sig_path, &fst) != 0) {
#  340|   			fprintf(stderr, "ERROR: stat: %s: %s\n", image_sig_path, strerror(errno));
#  341|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:380:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(image_sig_path, "rb")’
#  378|   				goto leave;
#  379|   			}
#  380|-> 			if (fstat(fileno(f), &fst) != 0) {
#  381|   				fprintf(stderr, "Error: fstat: %s\n", strerror(errno));
#  382|   				goto leave;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:380:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(image_sig_path, "rb")’
#  378|   				goto leave;
#  379|   			}
#  380|-> 			if (fstat(fileno(f), &fst) != 0) {
#  381|   				fprintf(stderr, "Error: fstat: %s\n", strerror(errno));
#  382|   				goto leave;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:398:29: warning[-Wanalyzer-null-argument]: use of NULL ‘image_path’ where non-null expected
/usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null
#  396|   			}
#  397|   		} else {
#  398|-> 			if (stat(image_path, &fst) != 0) {
#  399|   				fprintf(stderr, "Error: stat: '%s': %s\n", image_path, strerror(errno));
#  400|   				goto leave;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def7]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:398:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_path’ where non-null expected
/usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null
#  396|   			}
#  397|   		} else {
#  398|-> 			if (stat(image_path, &fst) != 0) {
#  399|   				fprintf(stderr, "Error: stat: '%s': %s\n", image_path, strerror(errno));
#  400|   				goto leave;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:505:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(string_build_path(image_path,  plist_get_string_ptr(plist_access_path(build_identity, 4, "Manifest", "PersonalizedDMG", "Info", "Path"), 0), 0), "rb")’
#  503|   			} else {
#  504|   				/* we need to re-connect in this case */
#  505|-> 				mobile_image_mounter_free(mim);
#  506|   				mim = NULL;
#  507|   				if (mobile_image_mounter_start_service(device, &mim, TOOL_NAME) != MOBILE_IMAGE_MOUNTER_E_SUCCESS) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:505:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(string_build_path(image_path,  plist_get_string_ptr(plist_access_path(build_identity, 4, "Manifest", "PersonalizedDMG", "Info", "Path"), 0), 0), "rb")’
#  503|   			} else {
#  504|   				/* we need to re-connect in this case */
#  505|-> 				mobile_image_mounter_free(mim);
#  506|   				mim = NULL;
#  507|   				if (mobile_image_mounter_start_service(device, &mim, TOOL_NAME) != MOBILE_IMAGE_MOUNTER_E_SUCCESS) {

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-250.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namelibimobiledevice-1.3.0^20230705git6fc41f5-5.fc41
diffbase-store-results-to/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz
diffbase-time-created2024-11-13 01:22:43
diffbase-time-finished2024-11-13 01:25:02
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-250.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibimobiledevice-1.3.0^20240916gited9703d-1.fc42
store-results-to/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz
time-created2024-11-13 01:25:27
time-finished2024-11-13 01:27:34
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9